# Reproduction files - Study 1 and study 2 Justification Rationality, Constructive Politics

# Deepening Bridging and Moving Minds in Stressful Times







# Session Information -----------------------------------------------------




#R version 4.3.2 (2023-10-31 ucrt)
#Platform: x86_64-w64-mingw32/x64 (64-bit)
#Running under: Windows 10 x64 (build 19045)
#
#Matrix products: default
#
#locale:
#  [1] LC_COLLATE=German_Germany.utf8  LC_CTYPE=German_Germany.utf8    LC_MONETARY=German_Germany.utf8 LC_NUMERIC=C                   
#[5] LC_TIME=German_Germany.utf8    
#
#attached base packages:
#  [1] stats     graphics  grDevices utils     datasets  methods   base     
#
#other attached packages:
#  [1] ggstance_0.3.6     broom_1.0.3        ordinal_2022.11-16 patchwork_1.3.0    sjPlot_2.8.12      psych_2.2.9        forcats_1.0.0     
#[8] stringr_1.5.0      dplyr_1.1.4        purrr_1.0.1        readr_2.1.4        tidyr_1.3.0        tibble_3.2.1       ggplot2_3.5.1     
#[15] tidyverse_1.3.2    haven_2.5.3        sjmisc_2.8.9      
#
#loaded via a namespace (and not attached):
#  [1] nlme_3.1-160        fs_1.6.1            lubridate_1.9.2     insight_0.19.0      httr_1.4.4          numDeriv_2016.8-1.1 tools_4.2.2        
#[8] backports_1.4.1     R6_2.5.1            sjlabelled_1.2.0    DBI_1.1.3           colorspace_2.1-0    withr_2.5.0         tidyselect_1.2.0   
#[15] Exact_3.2           mnormt_2.1.1        emmeans_1.8.4-1     compiler_4.2.2      performance_0.10.2  cli_3.6.0           rvest_1.0.3        
#[22] expm_0.999-7        xml2_1.3.3          sandwich_3.0-2      bayestestR_0.13.0   scales_1.3.0        mvtnorm_1.1-3       proxy_0.4-27       
#[29] minqa_1.2.5         pkgconfig_2.0.3     lme4_1.1-31         dbplyr_2.3.0        rlang_1.1.4         readxl_1.4.2        rstudioapi_0.14    
#[36] farver_2.1.1        generics_0.1.3      zoo_1.8-11          jsonlite_1.8.4      car_3.1-1           googlesheets4_1.0.1 magrittr_2.0.3     
#[43] Matrix_1.5-1        Rcpp_1.0.10         DescTools_0.99.50   munsell_0.5.0       abind_1.4-5         ucminf_1.1-4.1      lifecycle_1.0.3    
#[50] stringi_1.7.12      multcomp_1.4-22     carData_3.0-5       MASS_7.3-58.1       rootSolve_1.8.2.3   grid_4.2.2          parallel_4.2.2     
#[57] crayon_1.5.2        lmom_2.9            lattice_0.20-45     splines_4.2.2       ggeffects_1.1.5     sjstats_0.18.2      hms_1.1.2          
#[64] knitr_1.42          pillar_1.10.1       ggpubr_0.6.0        boot_1.3-28         gld_2.6.6           estimability_1.4.1  ggsignif_0.6.4     
#[71] codetools_0.2-18    reprex_2.0.2        glue_1.6.2          data.table_1.14.6   modelr_0.1.10       nloptr_2.0.3        vctrs_0.6.5        
#[78] tzdb_0.3.0          cellranger_1.1.0    gtable_0.3.1        assertthat_0.2.1    datawizard_0.6.5    xfun_0.37           xtable_1.8-4       
#[85] e1071_1.7-13        coda_0.19-4         rstatix_0.7.2       survival_3.4-0      class_7.3-20        googledrive_2.0.0   gargle_1.3.0       
#[92] timechange_0.2.0    TH.data_1.1-1       ellipsis_0.3.2




# Calculations ------------------------------------------------------------







# load necessary packages
library(sjmisc)
library(haven)
library(tidyverse)
library(psych)
library(sjPlot)
library(patchwork)
library(ordinal)
library(broom)
library(ggstance)



# 1. Reliability study 1 and study 2 --------------------------------------


# Study 1
# read dataset study 1
DE <- readRDS("data_de_wght.RDS")

DE <- DE %>% 
  filter(group_treatment <=3) # keep only groups with communicative intervention

# Justification rationality (study 1)
frq(DE$JR_VS == DE$JR_AR) # ratio of coding agreement (RCA): 95.47 %
cohen.kappa(cbind(DE$JR_VS, DE$JR_AR)) # kappa 0.93; weighted 0.97
cor.test(DE$JR_VS, DE$JR_AR, method = "spearman") # rho: 0.9645389
psych::alpha(cbind(DE$JR_VS, DE$JR_AR)) # std. alpha: 0.98

# Justification rationality (study 1) final codes
frq(DE$rj_codes) # 20.1 % 0; 37.97 % 1; 35.74 % 2; 6.2 % 3


# constructive proposal (study 1)
frq(DE$proposal_ST == DE$proposal_MS) # ratio of coding agreement (RCA): 87.37 %
cohen.kappa(cbind(DE$proposal_ST, DE$proposal_MS)) # kappa 0.62

# constructive proposal (study 1) final codes
frq(DE$proposal_final) # 77.44 % 0; 22.56 % 1


# Study 2
# read dataset study 2
AT <- readRDS("data_at_wght.RDS")

AT <- AT %>% 
  filter(group_treatment <=3) # keep only groups with communicative intervention


# Justification rationality (study 2)
frq(AT$JR_ST == AT$JR_AD) # ratio of coding agreement (RCA): 78 %
cohen.kappa(cbind(AT$JR_AD, AT$JR_ST)) # kappa 0.67; weighted 0.81
cor.test(AT$JR_AD, AT$JR_ST, method = "spearman") # rho: 0.806779
psych::alpha(cbind(AT$JR_AD, AT$JR_ST)) # std. alpha: 0.9

# Justification rationality (study 2) final codes
frq(AT$final_JR) # 19.89 % 0; 39.47 % 1; 36.51 % 2; 4.13 % 3


# constructive proposal (study 2)
frq(AT$proposal_ST == AT$proposal_MS) # ratio of coding agreement (RCA): 94 %
cohen.kappa(cbind(AT$proposal_ST, AT$proposal_MS)) # kappa 0.72

# constructive proposal (study 2) final codes
frq(AT$proposal_final) # 88.61 % 0; 11.39 % 1


# plot final codes study 1 and 2

p1 <- plot_frq(DE$rj_codes)+
  theme_bw()+
  xlab("Justification Rationality")+
  ggtitle("Study 1 (Germany)")+
  scale_x_discrete(
    labels = c("0" = "No justification", "1" = "Inferior justification", "2" = "Qualified justification", "3" = "Sophisticated justification")
  )+
  theme(axis.text.x = element_text(angle = 45, hjust = 1))


p2 <- plot_frq(AT$final_JR)+
  theme_bw()+
  xlab("Justification Rationality")+
  ggtitle("Study 2 (Austria)")+
  scale_x_discrete(
    labels = c("0" = "No justification", "1" = "Inferior justification", "2" = "Qualified justification", "3" = "Sophisticated justification")
  )+
  theme(axis.text.x = element_text(angle = 45, hjust = 1))


p3 <- plot_frq(DE$proposal_final)+
  theme_bw()+
  xlab("Constructive Politics")+
  scale_x_discrete(
    labels = c("0" = "No constructive proposal", "1" = "Constructive proposal")
  )+
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

p4 <- plot_frq(AT$proposal_final)+
  theme_bw()+
  xlab("Constructive Politics ")+
  scale_x_discrete(
    labels = c("0" = "No constructive proposal", "1" = "Constructive proposal")
  )+
  theme(axis.text.x = element_text(angle = 45, hjust = 1))


(p1+p2)/(p3+p4)
ggsave("JR_proposals_descriptives.png", width = 8, height = 8, dpi = 600)






# descriptives about AutoIC (Integrative Complexity) in both settings

frq(DE$autoic_IC)
plot_frq(DE$autoic_IC)+
  theme_bw()+
  xlab("integrative Complexity")


frq(AT$autoic_IC)
plot_frq(AT$autoic_IC)+
  theme_bw()+
  xlab("integrative Complexity")






# 2. Regression models ----------------------------------------------------



# Justification Rationality DE --------------------------------------------

# as factor
DE$treatment_fac <- car::recode(DE$group_treatment, recodes = "1='Contestatory'; 2='Collaborative'; 3='Open Communication'", as.factor = T)
DE$treatment_fac <- relevel(DE$treatment_fac, ref = "Collaborative")


# pro health cases
DE_health <- DE %>% 
  filter(position_pre_cont >=6)

# pro freedom cases
DE_free <- DE %>% 
  filter(position_pre_cont <=5)


# all cases
JR_DE <- lm(rj_codes ~ treatment_fac + index_corona_knowledge + leftright +
              trust_gov + trust_exp + index_cognition + index_evaluation +
              index_accuracy, data = DE)

# pro health cases
JR_DE_health <- lm(rj_codes ~ treatment_fac + index_corona_knowledge + leftright +
                     trust_gov + trust_exp + index_cognition + index_evaluation +
                     index_accuracy, data = DE_health)

# pro liberties cases
JR_DE_free <- lm(rj_codes ~ treatment_fac + index_corona_knowledge + leftright +
                   trust_gov + trust_exp + index_cognition + index_evaluation +
                   index_accuracy, data = DE_free)



# compare 3 models (all, health, freedom)
tab_model(JR_DE, JR_DE_health, JR_DE_free, auto.label = F)




# ordered logit
JR_DE_ordered <- MASS::polr(as.factor(rj_codes) ~ treatment_fac + index_corona_knowledge + leftright +
                        trust_gov + trust_exp + index_cognition + index_evaluation +
                        index_accuracy, data = DE, method = "logistic")

JR_DE_health_ordered <- MASS::polr(as.factor(rj_codes) ~ treatment_fac + index_corona_knowledge + leftright +
                              trust_gov + trust_exp + index_cognition + index_evaluation +
                              index_accuracy, data = DE_health, method = "logistic")

JR_DE_free_ordered <- MASS::polr(as.factor(rj_codes) ~ treatment_fac + index_corona_knowledge + leftright +
                              trust_gov + trust_exp + index_cognition + index_evaluation +
                              index_accuracy, data = DE_free, method = "logistic")


tab_model(JR_DE_ordered, JR_DE_health_ordered, JR_DE_free_ordered, auto.label = F)



# Justification Rationality AT --------------------------------------------

# as factor
AT$treatment_fac <- car::recode(AT$group_treatment, recodes = "1='Contestatory'; 2='Collaborative'; 3='Open Communication'", as.factor = T)
AT$treatment_fac <- relevel(AT$treatment_fac, ref = "Collaborative")

# pro health cases
AT_health <- AT %>% 
  filter(position_pre_cont >=6)

# pro freedom cases
AT_free <- AT %>% 
  filter(position_pre_cont <=5)




# getrennt für conspiracy high/low

# conspiracy high
AT_conspiracy_hi<- AT %>% 
  filter(conspiracy_myths_split ==1)

# conspiracy low
AT_conspiracy_lo<- AT %>% 
  filter(conspiracy_myths_split ==0)


# all cases
JR_AT <- lm(final_JR ~ treatment_fac + index_corona_knowledge + leftright +
              trust_gov + trust_exp + index_cognition + index_evaluation +
              index_accuracy, data = AT)

# pro health cases
JR_AT_health <- lm(final_JR ~ treatment_fac + index_corona_knowledge + leftright +
                     trust_gov + trust_exp + index_cognition + index_evaluation +
                     index_accuracy, data = AT_health)

# pro liberties cases
JR_AT_free <- lm(final_JR ~ treatment_fac + index_corona_knowledge + leftright +
                   trust_gov + trust_exp + index_cognition + index_evaluation +
                   index_accuracy, data = AT_free)




# compare 3 models (all, health, freedom)
tab_model(JR_AT, JR_AT_health, JR_AT_free, auto.label = F)





# ordered logit
JR_AT_ordered <- MASS::polr(as.factor(final_JR) ~ treatment_fac + index_corona_knowledge + leftright +
                              trust_gov + trust_exp + index_cognition + index_evaluation +
                              index_accuracy, data = AT, method = "logistic")

JR_AT_health_ordered <- MASS::polr(as.factor(final_JR) ~ treatment_fac + index_corona_knowledge + leftright +
                                     trust_gov + trust_exp + index_cognition + index_evaluation +
                                     index_accuracy, data = AT_health, method = "logistic")

JR_AT_free_ordered <- MASS::polr(as.factor(final_JR) ~ treatment_fac + index_corona_knowledge + leftright +
                                   trust_gov + trust_exp + index_cognition + index_evaluation +
                                   index_accuracy, data = AT_free, method = "logistic")


tab_model(JR_AT_ordered, JR_AT_health_ordered, JR_AT_free_ordered, auto.label = F)







# Constructive proposal DE ------------------------------------------------

# all cases
DE_proposal <- glm(proposal_final ~ treatment_fac + index_corona_knowledge + leftright +
                     trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy, 
                   family=binomial(link='logit'),data=DE)

# pro health cases
DE_proposal_health <- glm(proposal_final ~ treatment_fac + index_corona_knowledge + leftright +
                            trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy, 
                          family=binomial(link='logit'),data=DE_health)

# pro freedom cases
DE_proposal_free <- glm(proposal_final ~ treatment_fac + index_corona_knowledge + leftright +
                          trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy, 
                        family=binomial(link='logit'),data=DE_free)


tab_model(DE_proposal, DE_proposal_health, DE_proposal_free, auto.label = F,
          dv.labels = c("proposal Germany (all cases)", "proposal Germany (pro health)",
                        "proposal Germany (pro civil liberties)"))
# In all 3 models: negative effects of contestatory and open communication (compared to collaborative)




# Constructive proposal AT ------------------------------------------------

# all cases
AT_proposal <- glm(proposal_final ~ treatment_fac + index_corona_knowledge + leftright +
                     trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy, 
                   family=binomial(link='logit'),data=AT)

# pro health cases
AT_proposal_health <- glm(proposal_final ~ treatment_fac + index_corona_knowledge + leftright +
                            trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy, 
                          family=binomial(link='logit'),data=AT_health)

# pro freedom cases
AT_proposal_free <- glm(proposal_final ~ treatment_fac + index_corona_knowledge + leftright +
                          trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy, 
                        family=binomial(link='logit'),data=AT_free)


# conspiracy high cases
AT_proposal_conspiracy_hi <- glm(proposal_final ~ treatment_fac + index_corona_knowledge + leftright +
                                   trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy, 
                                 family=binomial(link='logit'),data=AT_conspiracy_hi)


# conspiracy low cases
AT_proposal_conspiracy_lo <- glm(proposal_final ~ treatment_fac + index_corona_knowledge + leftright +
                                   trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy, 
                                 family=binomial(link='logit'),data=AT_conspiracy_lo)


tab_model(AT_proposal, AT_proposal_health, AT_proposal_free, 
          AT_proposal_conspiracy_hi, AT_proposal_conspiracy_lo, auto.label = F,
          dv.labels = c("proposal Austria (all cases)", "proposal Austria (pro health)",
                        "proposal Austria (pro civil liberties)", "proposal Austria (conspiracy high)",
                        "proposal Austria (conspiracy low)"))


# In all 3 models: negative effects of contestatory and open communication (compared to collaborative)




# Automated integrative Complexity DE -------------------------------------


# all cases
DE_IC <- lm(autoic_IC ~ treatment_fac + index_corona_knowledge + leftright +
              trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy,
            data=DE)

# pro health cases
DE_IC_health <- lm(autoic_IC ~ treatment_fac + index_corona_knowledge + leftright +
                     trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy,
                   data=DE_health)

# pro freedom cases
DE_IC_free <- lm(autoic_IC ~ treatment_fac + index_corona_knowledge + leftright +
                   trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy,
                 data=DE_free)



tab_model(DE_IC, DE_IC_health, DE_IC_free, auto.label = F,
          dv.labels = c("Auto IC Germany (all cases)", "Auto IC Germany (pro health)",
                        "Auto IC Germany (pro civil liberties)"))
# No effects of the treatments on Integrative Complexity (AutoIC)









# Automated integrative Complexity AT -------------------------------------



# all cases
AT_IC <- lm(autoic_IC ~ treatment_fac + index_corona_knowledge + leftright +
              trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy,
            data=AT)

# pro health cases
AT_IC_health <- lm(autoic_IC ~ treatment_fac + index_corona_knowledge + leftright +
                     trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy,
                   data=AT_health)

# pro freedom cases
AT_IC_free <- lm(autoic_IC ~ treatment_fac + index_corona_knowledge + leftright +
                   trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy,
                 data=AT_free)



tab_model(AT_IC, AT_IC_health, AT_IC_free, auto.label = F,
          dv.labels = c("Auto IC Austria (all cases)", "Auto IC Austria (pro health)",
                        "Auto IC Austria (pro civil liberties)"))
# No effects of the treatments on Integrative Complexity (AutoIC)






# 3. Plots ----------------------------------------------------------------


# Germany

# 1. justification rationality


# all respondents
de_JR_N <- length(JR_DE$residuals) 
coef_plot_study1_mA <- plot_model(JR_DE, type = "est", show.values = T,
                                  auto.label = F, vline.color = "black", 
                                  value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                  value.offset =.35, order.terms = c(1:24),
                                  axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                 "Need for Cognition", "Trust experts",
                                                 "Trust government", "Leftright",
                                                 "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(title ="Justification Rationality", subtitle = "(A) All Participants", caption = paste0("N = ", de_JR_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))
coef_plot_study1_mA[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study1_mA[["layers"]][[1]][["aes_params"]]$alpha <- 0.5




# pro health respondents
de_JR_health_N <- length(JR_DE_health$residuals) 
coef_plot_study1_mB <- plot_model(JR_DE_health, type = "est", show.values = T,
                                  auto.label = F, vline.color = "black", 
                                  value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                  value.offset =.35, order.terms = c(1:24),
                                  axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                 "Need for Cognition", "Trust experts",
                                                 "Trust government", "Leftright",
                                                 "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(B) Pro Health", caption = paste0("N = ", de_JR_health_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))+
  theme(axis.text.y = element_blank())
coef_plot_study1_mB[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study1_mB[["layers"]][[1]][["aes_params"]]$alpha <- 0.5




# pro free respondents
de_JR_free_N <- length(JR_DE_free$residuals) 
coef_plot_study1_mC <- plot_model(JR_DE_free, type = "est", show.values = T,
                                  auto.label = F, vline.color = "black", 
                                  value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                  value.offset =.35, order.terms = c(1:24),
                                  axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                 "Need for Cognition", "Trust experts",
                                                 "Trust government", "Leftright",
                                                 "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(C) Pro Civil-Liberties", caption = paste0("N = ", de_JR_free_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))+
  theme(axis.text.y = element_blank())
coef_plot_study1_mC[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study1_mC[["layers"]][[1]][["aes_params"]]$alpha <- 0.5



# JR study 1
coef_plot_study1_mA+coef_plot_study1_mB+coef_plot_study1_mC



# 2. constructive proposal

# all respondents
de_prop_N <- length(DE_proposal$residuals) 
coef_plot_study1_m2A <- plot_model(DE_proposal, type = "est", show.values = T,
                                   auto.label = F, vline.color = "black", 
                                   value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                   value.offset =.35, order.terms = c(1:24),
                                   axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                  "Need for Cognition", "Trust experts",
                                                  "Trust government", "Leftright",
                                                  "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(title = "Constructive Proposal", subtitle = "(A) All Participants", caption = paste0("N = ", de_prop_N))+
  theme_sjplot()+
  scale_y_log10(limits = c(0.008, 10))
coef_plot_study1_m2A[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study1_m2A[["layers"]][[1]][["aes_params"]]$alpha <- 0.5


# pro health respondents
de_prop_health_N <- length(DE_proposal_health$residuals) 
coef_plot_study1_m2B <- plot_model(DE_proposal_health, type = "est", show.values = T,
                                   auto.label = F, vline.color = "black", 
                                   value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                   value.offset =.35, order.terms = c(1:24),
                                   axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                  "Need for Cognition", "Trust experts",
                                                  "Trust government", "Leftright",
                                                  "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(B) Pro Health", caption = paste0("N = ", de_prop_health_N))+
  theme_sjplot()+
  scale_y_log10(limits = c(0.008, 10))+
  theme(axis.text.y = element_blank())
coef_plot_study1_m2B[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study1_m2B[["layers"]][[1]][["aes_params"]]$alpha <- 0.5



# pro free respondents
de_prop_free_N <- length(DE_proposal_free$residuals) 
coef_plot_study1_m2C <- plot_model(DE_proposal_free, type = "est", show.values = T,
                                   auto.label = F, vline.color = "black", 
                                   value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                   value.offset =.35, order.terms = c(1:24),
                                   axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                  "Need for Cognition", "Trust experts",
                                                  "Trust government", "Leftright",
                                                  "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(C) Pro Civil-Liberties", caption = paste0("N = ", de_prop_free_N))+
  theme_sjplot()+
  scale_y_log10(limits = c(0.008, 10))+
  theme(axis.text.y = element_blank())
coef_plot_study1_m2C[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study1_m2C[["layers"]][[1]][["aes_params"]]$alpha <- 0.5

p_part1DE <- (coef_plot_study1_mA+coef_plot_study1_mB+coef_plot_study1_mC)

p_part2DE <- (coef_plot_study1_m2A+coef_plot_study1_m2B+coef_plot_study1_m2C)


p_part1DE/p_part2DE

ggsave("study1_JR_proposal_reg.png", height = 7, width = 10, dpi = 300)
















# Austria

# 1. justification rationality


# all respondents
at_JR_N <- length(JR_AT$residuals) 
coef_plot_study2_mA <- plot_model(JR_AT, type = "est", show.values = T,
                                  auto.label = F, vline.color = "black", 
                                  value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                  value.offset =.35, order.terms = c(1:24),
                                  axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                 "Need for Cognition", "Trust experts",
                                                 "Trust government", "Leftright",
                                                 "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(title ="Justification Rationality", subtitle = "(A) All Participants", caption = paste0("N = ", at_JR_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))
coef_plot_study2_mA[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study2_mA[["layers"]][[1]][["aes_params"]]$alpha <- 0.5




# pro health respondents
at_JR_health_N <- length(JR_AT_health$residuals) 
coef_plot_study2_mB <- plot_model(JR_AT_health, type = "est", show.values = T,
                                  auto.label = F, vline.color = "black", 
                                  value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                  value.offset =.35, order.terms = c(1:24),
                                  axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                 "Need for Cognition", "Trust experts",
                                                 "Trust government", "Leftright",
                                                 "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(B) Pro Health", caption = paste0("N = ", at_JR_health_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))+
  theme(axis.text.y = element_blank())
coef_plot_study2_mB[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study2_mB[["layers"]][[1]][["aes_params"]]$alpha <- 0.5




# pro free respondents
at_JR_free_N <- length(JR_AT_free$residuals) 
coef_plot_study2_mC <- plot_model(JR_AT_free, type = "est", show.values = T,
                                  auto.label = F, vline.color = "black", 
                                  value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                  value.offset =.35, order.terms = c(1:24),
                                  axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                 "Need for Cognition", "Trust experts",
                                                 "Trust government", "Leftright",
                                                 "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(C) Pro Civil-Liberties", caption = paste0("N = ", at_JR_free_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))+
  theme(axis.text.y = element_blank())
coef_plot_study2_mC[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study2_mC[["layers"]][[1]][["aes_params"]]$alpha <- 0.5




coef_plot_study2_mA+coef_plot_study2_mB+coef_plot_study2_mC



# 2. constructive proposal

# all respondents
at_prop_N <- length(AT_proposal$residuals) 
coef_plot_study2_m2A <- plot_model(AT_proposal, type = "est", show.values = T,
                                   auto.label = F, vline.color = "black", 
                                   value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                   value.offset =.35, order.terms = c(1:24),
                                   axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                  "Need for Cognition", "Trust experts",
                                                  "Trust government", "Leftright",
                                                  "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(title = "Constructive Proposal", subtitle = "(A) All Participants", caption = paste0("N = ", at_prop_N))+
  theme_sjplot()+
  scale_y_log10(limits = c(0.008, 10))
coef_plot_study2_m2A[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study2_m2A[["layers"]][[1]][["aes_params"]]$alpha <- 0.5


# pro health respondents
at_prop_health_N <- length(AT_proposal_health$residuals) 
coef_plot_study2_m2B <- plot_model(AT_proposal_health, type = "est", show.values = T,
                                   auto.label = F, vline.color = "black", 
                                   value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                   value.offset =.35, order.terms = c(1:24),
                                   axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                  "Need for Cognition", "Trust experts",
                                                  "Trust government", "Leftright",
                                                  "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(B) Pro Health", caption = paste0("N = ", at_prop_health_N))+
  theme_sjplot()+
  scale_y_log10(limits = c(0.008, 10))+
  theme(axis.text.y = element_blank())
coef_plot_study2_m2B[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study2_m2B[["layers"]][[1]][["aes_params"]]$alpha <- 0.5



# pro free respondents
at_prop_free_N <- length(AT_proposal_free$residuals) 
coef_plot_study2_m2C <- plot_model(AT_proposal_free, type = "est", show.values = T,
                                   auto.label = F, vline.color = "black", 
                                   value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                   value.offset =.35, order.terms = c(1:24),
                                   axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                  "Need for Cognition", "Trust experts",
                                                  "Trust government", "Leftright",
                                                  "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(C) Pro Civil-Liberties", caption = paste0("N = ", at_prop_free_N))+
  theme_sjplot()+
  scale_y_log10(limits = c(0.008, 10))+
  theme(axis.text.y = element_blank())
coef_plot_study2_m2C[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study2_m2C[["layers"]][[1]][["aes_params"]]$alpha <- 0.5

p_part1AT <- (coef_plot_study2_mA+coef_plot_study2_mB+coef_plot_study2_mC)

p_part2AT <- (coef_plot_study2_m2A+coef_plot_study2_m2B+coef_plot_study2_m2C)


p_part1AT/p_part2AT

ggsave("study2_JR_proposal.png", height = 7, width = 10, dpi = 300)







# intergative complexity
# AutoIC Germany

# all respondents
de_IC_N <- length(DE_IC$residuals) 
coef_plot_study1_IC_all <- plot_model(DE_IC, type = "est", show.values = T,
                                      auto.label = F, vline.color = "black", 
                                      value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                      value.offset =.35, order.terms = c(1:24),
                                      axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                     "Need for Cognition", "Trust experts",
                                                     "Trust government", "Leftright",
                                                     "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(title ="Study 1 (Germany)", subtitle = "(A) All Participants", caption = paste0("N = ", de_IC_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))
coef_plot_study1_IC_all[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study1_IC_all[["layers"]][[1]][["aes_params"]]$alpha <- 0.5




# pro health respondents
de_IC_health_N <- length(DE_IC_health$residuals) 
coef_plot_study1_IC_health <- plot_model(DE_IC_health, type = "est", show.values = T,
                                         auto.label = F, vline.color = "black", 
                                         value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                         value.offset =.35, order.terms = c(1:24),
                                         axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                        "Need for Cognition", "Trust experts",
                                                        "Trust government", "Leftright",
                                                        "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(B) Pro Health", caption = paste0("N = ", de_IC_health_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))+
  theme(axis.text.y = element_blank())
coef_plot_study1_IC_health[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study1_IC_health[["layers"]][[1]][["aes_params"]]$alpha <- 0.5




# pro free respondents
de_IC_free_N <- length(DE_IC_free$residuals) 
coef_plot_study1_IC_free <- plot_model(DE_IC_free, type = "est", show.values = T,
                                       auto.label = F, vline.color = "black", 
                                       value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                       value.offset =.35, order.terms = c(1:24),
                                       axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                      "Need for Cognition", "Trust experts",
                                                      "Trust government", "Leftright",
                                                      "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(C) Pro Civil-Liberties", caption = paste0("N = ", de_IC_free_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))+
  theme(axis.text.y = element_blank())
coef_plot_study1_IC_free[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study1_IC_free[["layers"]][[1]][["aes_params"]]$alpha <- 0.5




coef_plot_study1_IC_all+coef_plot_study1_IC_health+coef_plot_study1_IC_free



# AutoIC Austria

# all respondents
at_IC_N <- length(AT_IC$residuals) 
coef_plot_study2_IC_all <- plot_model(AT_IC, type = "est", show.values = T,
                                      auto.label = F, vline.color = "black", 
                                      value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                      value.offset =.35, order.terms = c(1:24),
                                      axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                     "Need for Cognition", "Trust experts",
                                                     "Trust government", "Leftright",
                                                     "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(title ="Study 2 (Austria)", subtitle = "(A) All Participants", caption = paste0("N = ", at_IC_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))
coef_plot_study2_IC_all[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study2_IC_all[["layers"]][[1]][["aes_params"]]$alpha <- 0.5




# pro health respondents
at_IC_health_N <- length(AT_IC_health$residuals) 
coef_plot_study2_IC_health <- plot_model(AT_IC_health, type = "est", show.values = T,
                                         auto.label = F, vline.color = "black", 
                                         value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                         value.offset =.35, order.terms = c(1:24),
                                         axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                        "Need for Cognition", "Trust experts",
                                                        "Trust government", "Leftright",
                                                        "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(B) Pro Health", caption = paste0("N = ", at_IC_health_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))+
  theme(axis.text.y = element_blank())
coef_plot_study2_IC_health[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study2_IC_health[["layers"]][[1]][["aes_params"]]$alpha <- 0.5




# pro free respondents
at_IC_free_N <- length(AT_IC_free$residuals) 
coef_plot_study2_IC_free <- plot_model(AT_IC_free, type = "est", show.values = T,
                                       auto.label = F, vline.color = "black", 
                                       value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                       value.offset =.35, order.terms = c(1:24),
                                       axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                      "Need for Cognition", "Trust experts",
                                                      "Trust government", "Leftright",
                                                      "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(C) Pro Civil-Liberties", caption = paste0("N = ", at_IC_free_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))+
  theme(axis.text.y = element_blank())
coef_plot_study2_IC_free[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study2_IC_free[["layers"]][[1]][["aes_params"]]$alpha <- 0.5



(coef_plot_study1_IC_all+coef_plot_study1_IC_health+coef_plot_study1_IC_free)/(coef_plot_study2_IC_all+coef_plot_study2_IC_health+coef_plot_study2_IC_free)


ggsave("AutoIC_study1_study2.png", height = 7, width = 10, dpi = 300)









# 4. Regression models weighted -------------------------------------------







# Justification Rationality DE --------------------------------------------


# all cases
JR_DE <- lm(rj_codes ~ treatment_fac + index_corona_knowledge + leftright +
              trust_gov + trust_exp + index_cognition + index_evaluation +
              index_accuracy, data = DE, weights = DE$wght)

# pro health cases
JR_DE_health <- lm(rj_codes ~ treatment_fac + index_corona_knowledge + leftright +
                     trust_gov + trust_exp + index_cognition + index_evaluation +
                     index_accuracy, data = DE_health, weights = DE_health$wght)

# pro liberties cases
JR_DE_free <- lm(rj_codes ~ treatment_fac + index_corona_knowledge + leftright +
                   trust_gov + trust_exp + index_cognition + index_evaluation +
                   index_accuracy, data = DE_free, weights = DE_free$wght)



# compare 3 models (all, health, freedom)
tab_model(JR_DE, JR_DE_health, JR_DE_free, auto.label = F)



# Justification Rationality AT --------------------------------------------



# all cases
JR_AT <- lm(final_JR ~ treatment_fac + index_corona_knowledge + leftright +
              trust_gov + trust_exp + index_cognition + index_evaluation +
              index_accuracy, data = AT, weights = AT$wght)

# pro health cases
JR_AT_health <- lm(final_JR ~ treatment_fac + index_corona_knowledge + leftright +
                     trust_gov + trust_exp + index_cognition + index_evaluation +
                     index_accuracy, data = AT_health, weights = AT_health$wght)

# pro liberties cases
JR_AT_free <- lm(final_JR ~ treatment_fac + index_corona_knowledge + leftright +
                   trust_gov + trust_exp + index_cognition + index_evaluation +
                   index_accuracy, data = AT_free, wghts = AT_free$wght)




# compare 3 models (all, health, freedom)
tab_model(JR_AT, JR_AT_health, JR_AT_free, auto.label = F)


# Constructive proposal DE ------------------------------------------------

# all cases
DE_proposal <- glm(proposal_final ~ treatment_fac + index_corona_knowledge + leftright +
                     trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy, 
                   family=binomial(link='logit'),data=DE, weights = DE$wght)

# pro health cases
DE_proposal_health <- glm(proposal_final ~ treatment_fac + index_corona_knowledge + leftright +
                            trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy, 
                          family=binomial(link='logit'),data=DE_health, weights = DE_health$wght)

# pro freedom cases
DE_proposal_free <- glm(proposal_final ~ treatment_fac + index_corona_knowledge + leftright +
                          trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy, 
                        family=binomial(link='logit'),data=DE_free, weights = DE_free$wght)


tab_model(DE_proposal, DE_proposal_health, DE_proposal_free, auto.label = F,
          dv.labels = c("proposal Germany (all cases)", "proposal Germany (pro health)",
                        "proposal Germany (pro civil liberties)"))
# In all 3 models: negative effects of contestatory and open communication (compared to collaborative)




# Constructive proposal AT ------------------------------------------------

# all cases
AT_proposal <- glm(proposal_final ~ treatment_fac + index_corona_knowledge + leftright +
                     trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy, 
                   family=binomial(link='logit'),data=AT, weights = AT$wght)

# pro health cases
AT_proposal_health <- glm(proposal_final ~ treatment_fac + index_corona_knowledge + leftright +
                            trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy, 
                          family=binomial(link='logit'),data=AT_health, weights = AT_health$wght)

# pro freedom cases
AT_proposal_free <- glm(proposal_final ~ treatment_fac + index_corona_knowledge + leftright +
                          trust_gov + trust_exp + index_cognition + index_evaluation + index_accuracy, 
                        family=binomial(link='logit'),data=AT_free, weights = AT_free$wght)


tab_model(AT_proposal, AT_proposal_health, AT_proposal_free, 
           auto.label = F,
          dv.labels = c("proposal Austria (all cases)", "proposal Austria (pro health)",
                        "proposal Austria (pro civil liberties)"))


# In all 3 models: negative effects of contestatory and open communication (compared to collaborative)





# Germany

# 1. justification rationality


# all respondents
de_JR_N <- length(JR_DE$residuals) 
coef_plot_study1_mA <- plot_model(JR_DE, type = "est", show.values = T,
                                  auto.label = F, vline.color = "black", 
                                  value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                  value.offset =.35, order.terms = c(1:24),
                                  axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                 "Need for Cognition", "Trust experts",
                                                 "Trust government", "Leftright",
                                                 "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(title ="Justification Rationality", subtitle = "(A) All Participants", caption = paste0("N = ", de_JR_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))
coef_plot_study1_mA[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study1_mA[["layers"]][[1]][["aes_params"]]$alpha <- 0.5




# pro health respondents
de_JR_health_N <- length(JR_DE_health$residuals) 
coef_plot_study1_mB <- plot_model(JR_DE_health, type = "est", show.values = T,
                                  auto.label = F, vline.color = "black", 
                                  value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                  value.offset =.35, order.terms = c(1:24),
                                  axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                 "Need for Cognition", "Trust experts",
                                                 "Trust government", "Leftright",
                                                 "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(B) Pro Health", caption = paste0("N = ", de_JR_health_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))+
  theme(axis.text.y = element_blank())
coef_plot_study1_mB[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study1_mB[["layers"]][[1]][["aes_params"]]$alpha <- 0.5




# pro free respondents
de_JR_free_N <- length(JR_DE_free$residuals) 
coef_plot_study1_mC <- plot_model(JR_DE_free, type = "est", show.values = T,
                                  auto.label = F, vline.color = "black", 
                                  value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                  value.offset =.35, order.terms = c(1:24),
                                  axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                 "Need for Cognition", "Trust experts",
                                                 "Trust government", "Leftright",
                                                 "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(C) Pro Civil-Liberties", caption = paste0("N = ", de_JR_free_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))+
  theme(axis.text.y = element_blank())
coef_plot_study1_mC[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study1_mC[["layers"]][[1]][["aes_params"]]$alpha <- 0.5



# JR study 1
coef_plot_study1_mA+coef_plot_study1_mB+coef_plot_study1_mC



# 2. constructive proposal

# all respondents
de_prop_N <- length(DE_proposal$residuals) 
coef_plot_study1_m2A <- plot_model(DE_proposal, type = "est", show.values = T,
                                   auto.label = F, vline.color = "black", 
                                   value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                   value.offset =.35, order.terms = c(1:24),
                                   axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                  "Need for Cognition", "Trust experts",
                                                  "Trust government", "Leftright",
                                                  "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(title = "Constructive Proposal", subtitle = "(A) All Participants", caption = paste0("N = ", de_prop_N))+
  theme_sjplot()+
  scale_y_log10(limits = c(0.008, 10))
coef_plot_study1_m2A[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study1_m2A[["layers"]][[1]][["aes_params"]]$alpha <- 0.5


# pro health respondents
de_prop_health_N <- length(DE_proposal_health$residuals) 
coef_plot_study1_m2B <- plot_model(DE_proposal_health, type = "est", show.values = T,
                                   auto.label = F, vline.color = "black", 
                                   value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                   value.offset =.35, order.terms = c(1:24),
                                   axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                  "Need for Cognition", "Trust experts",
                                                  "Trust government", "Leftright",
                                                  "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(B) Pro Health", caption = paste0("N = ", de_prop_health_N))+
  theme_sjplot()+
  scale_y_log10(limits = c(0.008, 10))+
  theme(axis.text.y = element_blank())
coef_plot_study1_m2B[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study1_m2B[["layers"]][[1]][["aes_params"]]$alpha <- 0.5



# pro free respondents
de_prop_free_N <- length(DE_proposal_free$residuals) 
coef_plot_study1_m2C <- plot_model(DE_proposal_free, type = "est", show.values = T,
                                   auto.label = F, vline.color = "black", 
                                   value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                   value.offset =.35, order.terms = c(1:24),
                                   axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                  "Need for Cognition", "Trust experts",
                                                  "Trust government", "Leftright",
                                                  "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(C) Pro Civil-Liberties", caption = paste0("N = ", de_prop_free_N))+
  theme_sjplot()+
  scale_y_log10(limits = c(0.007, 10))+
  theme(axis.text.y = element_blank())
coef_plot_study1_m2C[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study1_m2C[["layers"]][[1]][["aes_params"]]$alpha <- 0.5

p_part1DE <- (coef_plot_study1_mA+coef_plot_study1_mB+coef_plot_study1_mC)

p_part2DE <- (coef_plot_study1_m2A+coef_plot_study1_m2B+coef_plot_study1_m2C)


p_part1DE/p_part2DE

ggsave("study1_JR_proposal_reg_wght.png", height = 7, width = 10, dpi = 300)
















# Austria

# 1. justification rationality


# all respondents
at_JR_N <- length(JR_AT$residuals) 
coef_plot_study2_mA <- plot_model(JR_AT, type = "est", show.values = T,
                                  auto.label = F, vline.color = "black", 
                                  value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                  value.offset =.35, order.terms = c(1:24),
                                  axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                 "Need for Cognition", "Trust experts",
                                                 "Trust government", "Leftright",
                                                 "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(title ="Justification Rationality", subtitle = "(A) All Participants", caption = paste0("N = ", at_JR_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))
coef_plot_study2_mA[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study2_mA[["layers"]][[1]][["aes_params"]]$alpha <- 0.5




# pro health respondents
at_JR_health_N <- length(JR_AT_health$residuals) 
coef_plot_study2_mB <- plot_model(JR_AT_health, type = "est", show.values = T,
                                  auto.label = F, vline.color = "black", 
                                  value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                  value.offset =.35, order.terms = c(1:24),
                                  axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                 "Need for Cognition", "Trust experts",
                                                 "Trust government", "Leftright",
                                                 "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(B) Pro Health", caption = paste0("N = ", at_JR_health_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))+
  theme(axis.text.y = element_blank())
coef_plot_study2_mB[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study2_mB[["layers"]][[1]][["aes_params"]]$alpha <- 0.5




# pro free respondents
at_JR_free_N <- length(JR_AT_free$residuals) 
coef_plot_study2_mC <- plot_model(JR_AT_free, type = "est", show.values = T,
                                  auto.label = F, vline.color = "black", 
                                  value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                  value.offset =.35, order.terms = c(1:24),
                                  axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                 "Need for Cognition", "Trust experts",
                                                 "Trust government", "Leftright",
                                                 "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(C) Pro Civil-Liberties", caption = paste0("N = ", at_JR_free_N))+
  theme_sjplot()+
  scale_y_continuous(limits = c(-1,1))+
  theme(axis.text.y = element_blank())
coef_plot_study2_mC[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study2_mC[["layers"]][[1]][["aes_params"]]$alpha <- 0.5




coef_plot_study2_mA+coef_plot_study2_mB+coef_plot_study2_mC



# 2. constructive proposal

# all respondents
at_prop_N <- length(AT_proposal$residuals) 
coef_plot_study2_m2A <- plot_model(AT_proposal, type = "est", show.values = T,
                                   auto.label = F, vline.color = "black", 
                                   value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                   value.offset =.35, order.terms = c(1:24),
                                   axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                  "Need for Cognition", "Trust experts",
                                                  "Trust government", "Leftright",
                                                  "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(title = "Constructive Proposal", subtitle = "(A) All Participants", caption = paste0("N = ", at_prop_N))+
  theme_sjplot()+
  scale_y_log10(limits = c(0.008, 10))
coef_plot_study2_m2A[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study2_m2A[["layers"]][[1]][["aes_params"]]$alpha <- 0.5


# pro health respondents
at_prop_health_N <- length(AT_proposal_health$residuals) 
coef_plot_study2_m2B <- plot_model(AT_proposal_health, type = "est", show.values = T,
                                   auto.label = F, vline.color = "black", 
                                   value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                   value.offset =.35, order.terms = c(1:24),
                                   axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                  "Need for Cognition", "Trust experts",
                                                  "Trust government", "Leftright",
                                                  "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(B) Pro Health", caption = paste0("N = ", at_prop_health_N))+
  theme_sjplot()+
  scale_y_log10(limits = c(0.008, 10))+
  theme(axis.text.y = element_blank())
coef_plot_study2_m2B[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study2_m2B[["layers"]][[1]][["aes_params"]]$alpha <- 0.5



# pro free respondents
at_prop_free_N <- length(AT_proposal_free$residuals) 
coef_plot_study2_m2C <- plot_model(AT_proposal_free, type = "est", show.values = T,
                                   auto.label = F, vline.color = "black", 
                                   value.size = 2.5, dot.size = 1.5, line.size = .5, 
                                   value.offset =.35, order.terms = c(1:24),
                                   axis.labels= c("Accuracy motivation", "Neeed for Evaluation",
                                                  "Need for Cognition", "Trust experts",
                                                  "Trust government", "Leftright",
                                                  "Corona knowledge", "Open Communication", "Contestatory"))+
  labs(subtitle = "(C) Pro Civil-Liberties", caption = paste0("N = ", at_prop_free_N))+
  theme_sjplot()+
  scale_y_log10(limits = c(0.008, 10))+
  theme(axis.text.y = element_blank())
coef_plot_study2_m2C[["layers"]][[1]][["aes_params"]]$size <- 0.3
coef_plot_study2_m2C[["layers"]][[1]][["aes_params"]]$alpha <- 0.5

p_part1AT <- (coef_plot_study2_mA+coef_plot_study2_mB+coef_plot_study2_mC)

p_part2AT <- (coef_plot_study2_m2A+coef_plot_study2_m2B+coef_plot_study2_m2C)


p_part1AT/p_part2AT

ggsave("study2_JR_proposal_wght.png", height = 7, width = 10, dpi = 300)




